package com.db.bankapp.domain;

/**
 * @ThreadSafe
 * FIFO (First In First Out) interface.
 */
interface Queue<T> {
    /**
     * Adds element to queue
     * @param elem to add
     * @throws InterruptedException when adding thread is interrupted
     */
    void add(T elem) throws InterruptedException;

    /**
     * Removes element from queu and returns it
     * @return element from queue
     * @throws InterruptedException when removing thread is interrupted
     */
    T remove() throws InterruptedException;

    /**
     * Checks if queue is empty
     * @return true if queue is empty, false otherwise
     */
    boolean isEmpty();
}
